<template>
  <div>
    <div>{{ $store.state.user.token }}</div>
    <div>{{ $store.state.setting.name }}</div>
    <button @click="setNewst(666)">修改token</button>
    <button @click="$store.commit('setNewState', 'huli')">修改name</button>
  </div>
</template>

<script>
// import { mapMutations } from "vuex";
import { createNamespacedHelpers } from "vuex";
//调用时传入命名空间名称
const { mapMutations } = createNamespacedHelpers("user");
export default {
  methods: {
    ...mapMutations(["setNewst"]),
  },
};
</script>

<style>
</style>